import 'package:base_plugin/base_plugin.dart';
import 'package:finance_app/src/common/app_colors.dart';
import 'package:flutter/material.dart';

class TimeSelectItem extends StatelessWidget {
  final String title;
  final String value;
  final VoidCallback onTap;

  TimeSelectItem({Key key, this.title, this.value, this.onTap})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Center(
      child: SizedBox(
        width: getDp(305),
        child: PressedOpacityButton(
          onPressed: onTap,
          color: Colors.white,
          disabledColor: Colors.white,
          padding: EdgeInsets.symmetric(
            vertical: title == null ? getDp(19) : getDp(10),
            horizontal: getDp(16),
          ),
          borderRadius: BorderRadius.circular(getDp(15)),
          border: Border.all(
            color: aceGrayColor,
            width: getDp(0.5),
          ),
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              if (title != null)
                Text(title,
                    style: TextStyle(
                      color: aceDarkGrayColor,
                      fontSize: getSp(12),
                      fontWeight: FontWeight.w400,
                      height: 16 / 12,
                    )),
              if (title != null)
                SizedBox(
                  height: getDp(3),
                ),
              Text(
                value,
                style: TextStyle(
                  color: onTap == null ? aceBlackColor : aceBlueColor,
                  fontSize: getSp(16),
                  fontWeight: FontWeight.w700,
                  height: 1,
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
